home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / exthandler / nsIExternalProtocolService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  190 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIExternalProtocolService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIExternalProtocolService_h__
  6. #define __gen_nsIExternalProtocolService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURI; /* forward declaration */
  18.  
  19. class nsIFile; /* forward declaration */
  20.  
  21. class nsIPrompt; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIExternalProtocolService */
  25. #define NS_IEXTERNALPROTOCOLSERVICE_IID_STR "a49813a4-98b7-4bdb-998c-8bd9704af0c0"
  26.  
  27. #define NS_IEXTERNALPROTOCOLSERVICE_IID \
  28.   {0xa49813a4, 0x98b7, 0x4bdb, \
  29.     { 0x99, 0x8c, 0x8b, 0xd9, 0x70, 0x4a, 0xf0, 0xc0 }}
  30.  
  31. /**
  32.  * The external protocol service is used for finding and launching
  33.  * platform specific applications for particular protocols.
  34.  *
  35.  * You can ask the external protocol service if it has an external
  36.  * handler for a given protocol scheme. And you can ask it to load 
  37.  * the url using the default handler.
  38.  */
  39. class NS_NO_VTABLE nsIExternalProtocolService : public nsISupports {
  40.  public: 
  41.  
  42.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEXTERNALPROTOCOLSERVICE_IID)
  43.  
  44.   /**
  45.    * Check whether a handler for a specific protocol exists.
  46.    * @param aProtocolScheme The scheme from a url: http, ftp, mailto, etc.
  47.    * @return true if we have a handler and false otherwise.
  48.    */
  49.   /* boolean externalProtocolHandlerExists (in string aProtocolScheme); */
  50.   NS_IMETHOD ExternalProtocolHandlerExists(const char *aProtocolScheme, PRBool *_retval) = 0;
  51.  
  52.   /**
  53.    * Check whether a handler for a specific protocol is "exposed" as a visible
  54.    * feature of the current application.
  55.    *
  56.    * An exposed protocol handler is one that can be used in all contexts.  A
  57.    * non-exposed protocol handler is one that can only be used internally by the
  58.    * application.  For example, a non-exposed protocol would not be loaded by the
  59.    * application in response to a link click or a X-remote openURL command.
  60.    * Instead, it would be deferred to the system's external protocol handler.
  61.    */
  62.   /* boolean isExposedProtocol (in string aProtocolScheme); */
  63.   NS_IMETHOD IsExposedProtocol(const char *aProtocolScheme, PRBool *_retval) = 0;
  64.  
  65.   /**
  66.    * Used to load a url via an external protocol handler (if one exists)
  67.    * @param aURL The url to load
  68.    */
  69.   /* void loadUrl (in nsIURI aURL); */
  70.   NS_IMETHOD LoadUrl(nsIURI *aURL) = 0;
  71.  
  72.   /**
  73.    * Used to load a URI via an external application. Might prompt the user for
  74.    * permission to load the external application. Replaces loadUrl()
  75.    *
  76.    * @param aURI    The URI to load
  77.    * @param aPrompt If null we grab one from windowwatcher if we need it
  78.    */
  79.   /* void loadURI (in nsIURI aURI, in nsIPrompt aPrompt); */
  80.   NS_IMETHOD LoadURI(nsIURI *aURI, nsIPrompt *aPrompt) = 0;
  81.  
  82.   /**
  83.    * Gets a human-readable description for the application responsible for
  84.    * handling a specific protocol.
  85.    *
  86.    * @param aScheme The scheme to look up. For example, "mms".
  87.    *
  88.    * @throw NS_ERROR_NOT_IMPLEMENTED
  89.    *        If getting descriptions for protocol helpers is not supported
  90.    * @throw NS_ERROR_NOT_AVAILABLE
  91.    *        If no protocol helper exists for this scheme, or if it is not
  92.    *        possible to get a description for it.
  93.    */
  94.   /* AString getApplicationDescription (in AUTF8String aScheme); */
  95.   NS_IMETHOD GetApplicationDescription(const nsACString & aScheme, nsAString & _retval) = 0;
  96.  
  97. };
  98.  
  99. /* Use this macro when declaring classes that implement this interface. */
  100. #define NS_DECL_NSIEXTERNALPROTOCOLSERVICE \
  101.   NS_IMETHOD ExternalProtocolHandlerExists(const char *aProtocolScheme, PRBool *_retval); \
  102.   NS_IMETHOD IsExposedProtocol(const char *aProtocolScheme, PRBool *_retval); \
  103.   NS_IMETHOD LoadUrl(nsIURI *aURL); \
  104.   NS_IMETHOD LoadURI(nsIURI *aURI, nsIPrompt *aPrompt); \
  105.   NS_IMETHOD GetApplicationDescription(const nsACString & aScheme, nsAString & _retval); 
  106.  
  107. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  108. #define NS_FORWARD_NSIEXTERNALPROTOCOLSERVICE(_to) \
  109.   NS_IMETHOD ExternalProtocolHandlerExists(const char *aProtocolScheme, PRBool *_retval) { return _to ExternalProtocolHandlerExists(aProtocolScheme, _retval); } \
  110.   NS_IMETHOD IsExposedProtocol(const char *aProtocolScheme, PRBool *_retval) { return _to IsExposedProtocol(aProtocolScheme, _retval); } \
  111.   NS_IMETHOD LoadUrl(nsIURI *aURL) { return _to LoadUrl(aURL); } \
  112.   NS_IMETHOD LoadURI(nsIURI *aURI, nsIPrompt *aPrompt) { return _to LoadURI(aURI, aPrompt); } \
  113.   NS_IMETHOD GetApplicationDescription(const nsACString & aScheme, nsAString & _retval) { return _to GetApplicationDescription(aScheme, _retval); } 
  114.  
  115. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  116. #define NS_FORWARD_SAFE_NSIEXTERNALPROTOCOLSERVICE(_to) \
  117.   NS_IMETHOD ExternalProtocolHandlerExists(const char *aProtocolScheme, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExternalProtocolHandlerExists(aProtocolScheme, _retval); } \
  118.   NS_IMETHOD IsExposedProtocol(const char *aProtocolScheme, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsExposedProtocol(aProtocolScheme, _retval); } \
  119.   NS_IMETHOD LoadUrl(nsIURI *aURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->LoadUrl(aURL); } \
  120.   NS_IMETHOD LoadURI(nsIURI *aURI, nsIPrompt *aPrompt) { return !_to ? NS_ERROR_NULL_POINTER : _to->LoadURI(aURI, aPrompt); } \
  121.   NS_IMETHOD GetApplicationDescription(const nsACString & aScheme, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetApplicationDescription(aScheme, _retval); } 
  122.  
  123. #if 0
  124. /* Use the code below as a template for the implementation class for this interface. */
  125.  
  126. /* Header file */
  127. class nsExternalProtocolService : public nsIExternalProtocolService
  128. {
  129. public:
  130.   NS_DECL_ISUPPORTS
  131.   NS_DECL_NSIEXTERNALPROTOCOLSERVICE
  132.  
  133.   nsExternalProtocolService();
  134.  
  135. private:
  136.   ~nsExternalProtocolService();
  137.  
  138. protected:
  139.   /* additional members */
  140. };
  141.  
  142. /* Implementation file */
  143. NS_IMPL_ISUPPORTS1(nsExternalProtocolService, nsIExternalProtocolService)
  144.  
  145. nsExternalProtocolService::nsExternalProtocolService()
  146. {
  147.   /* member initializers and constructor code */
  148. }
  149.  
  150. nsExternalProtocolService::~nsExternalProtocolService()
  151. {
  152.   /* destructor code */
  153. }
  154.  
  155. /* boolean externalProtocolHandlerExists (in string aProtocolScheme); */
  156. NS_IMETHODIMP nsExternalProtocolService::ExternalProtocolHandlerExists(const char *aProtocolScheme, PRBool *_retval)
  157. {
  158.     return NS_ERROR_NOT_IMPLEMENTED;
  159. }
  160.  
  161. /* boolean isExposedProtocol (in string aProtocolScheme); */
  162. NS_IMETHODIMP nsExternalProtocolService::IsExposedProtocol(const char *aProtocolScheme, PRBool *_retval)
  163. {
  164.     return NS_ERROR_NOT_IMPLEMENTED;
  165. }
  166.  
  167. /* void loadUrl (in nsIURI aURL); */
  168. NS_IMETHODIMP nsExternalProtocolService::LoadUrl(nsIURI *aURL)
  169. {
  170.     return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172.  
  173. /* void loadURI (in nsIURI aURI, in nsIPrompt aPrompt); */
  174. NS_IMETHODIMP nsExternalProtocolService::LoadURI(nsIURI *aURI, nsIPrompt *aPrompt)
  175. {
  176.     return NS_ERROR_NOT_IMPLEMENTED;
  177. }
  178.  
  179. /* AString getApplicationDescription (in AUTF8String aScheme); */
  180. NS_IMETHODIMP nsExternalProtocolService::GetApplicationDescription(const nsACString & aScheme, nsAString & _retval)
  181. {
  182.     return NS_ERROR_NOT_IMPLEMENTED;
  183. }
  184.  
  185. /* End of implementation class template. */
  186. #endif
  187.  
  188.  
  189. #endif /* __gen_nsIExternalProtocolService_h__ */
  190.